<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>index</title>
    <link rel="stylesheet" href="css/bootstrap.css" />
    <link rel="stylesheet" href="css/bootstrap-theme.min.css" />
    <script src="js/JQuery.js"></script>
    <script type="application/javascript" src="js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="css/index.css">
</head>
<script type="application/javascript">
    window.onload = function (){
      var closable = window.localStorage.getItem("closable");
      if(closable == "true"){
        window.close();
        window.localStorage.removeItem("closable");
      }
    }
</script>
<body>
<!--导入navigation.html中的nav-->
<div th:insert="~{navigation :: nav}"></div>
<!--主要内容模块-->
<div class="container-fluid main">
  <div class="row">
    <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12" style="">
      <h2><span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span><span style="margin-left: 10px;">发现</span></h2>
      <hr>
      <!--个人头像-->
      <div class="media" th:each="pagination : ${paginationDTO.dataDTOList}">
        <div class="media-left">
          <a href="#">
            <img class="media-object img-circle" th:src="${pagination.user.getAvatarUrl()}" alt="...">
          </a>
        </div>
        <div class="media-body">
          <h4 class="media-heading">
            <a th:href="@{'/questiondetail/'+${pagination.id}}" th:text="${pagination.title}"></a>
          </h4>
          <span th:text="${pagination.description}"></span><br>
          <span class="state-text"><span th:text="${pagination.commentCount}"></span>个回复<span style="margin: 0 10px 0px 10px;"> • </span><span th:text="${pagination.readCount}"></span>次浏览<span style="margin: 0 10px 0px 10px;"> • </span>创建日期：<span th:text="${#dates.format(pagination.gmtCreate,'yyyy-MM-dd HH:mm:ss')}"></span></span>

        </div>
      </div>
      <nav aria-label="Page navigation">
        <ul class="pagination">
          <!--第一页-->
          <li th:if="${paginationDTO.showFirstPage}">
            <a href="/?page=1" aria-label="Previous">
              <span aria-hidden="true">&lt;&lt;</span>
            </a>
          </li>
          <!--上一页-->
          <li th:if="${paginationDTO.showPreviousPage}">
            <a th:href="@{/(page=${paginationDTO.page-1})}" aria-label="Previous">
              <span aria-hidden="true">&lt;</span>
            </a>
          </li>
          <!--显示当前页-->
          <li th:each="page : ${paginationDTO.pages}" th:class="${paginationDTO.page == page} ? 'active' : ''"><a th:href="@{/(page=${page})}"  th:text="${page}"></a></li>
          <!--下一页-->
          <li th:if="${paginationDTO.showNextPage}">
            <a th:href="@{/(page=${paginationDTO.page+1})}" aria-label="Next">
              <span aria-hidden="true">&gt;</span>
            </a>
          </li>
          <!--最后一页-->
          <li th:if="${paginationDTO.showEndPage}">
            <a th:href="@{/(page=${paginationDTO.totalPage})}" aria-label="Next">
              <span aria-hidden="true">&gt;&gt;</span>
            </a>
          </li>
        </ul>
      </nav>
    </div>
    <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12" style="padding-top: 50px; margin-bottom: 30px">
      <h3>热门话题</h3>
    </div>
  </div>
</div>
</body>
</html>